package com.example.administrator.caigou51.activity;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.ab.util.AbViewUtil;
import com.alibaba.fastjson.JSON;
import com.example.administrator.caigou51.R;
import com.example.administrator.caigou51.bean.AboutUsBean;
import com.example.administrator.caigou51.bean.MainDataBean;
import com.example.administrator.caigou51.global.App;
import com.example.administrator.caigou51.global.Constant;
import com.example.administrator.caigou51.recyclerCard.basic.MaterialListView;
import com.example.administrator.caigou51.recyclerCard.card.AddAgainGoodsCard;
import com.example.administrator.caigou51.request.BaseResponse;
import com.example.administrator.caigou51.request.ICallBackForRequestServer;
import com.example.administrator.caigou51.request.RequestServerManager;

/**
 * Created by Administrator on 2016/9/22/022.
 */
public class AboutUsActivity  extends GBaseActivity {
    TextView textView1;
    TextView textView2;
    TextView textView3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        super.setContentViewFor720_1280(R.layout.activity_about);
        findViewByIds();
        TaskGetAboutUS(false);
        initDatas();
    }

    private void findViewByIds() {
        textView1= (TextView) findViewById(R.id.textView1);textView1.setText("");
        textView2= (TextView) findViewById(R.id.textView2);textView2.setText("");
        textView3= (TextView) findViewById(R.id.textView3);textView3.setText("");
    }
    private void initDatas() {
        setTopTitle("关于我们");

    }


    @Override
    public void doClickRightImg() {
        super.doClickRightImg();
        App.showPopupWindow(getRightImageView(),AboutUsActivity.this,-124,-30);
    }

    private void TaskGetAboutUS(final boolean isloadmore) {
        RequestServerManager.getInstanceDIY().handleMethodDIY((GBaseActivity) getActivity(), null, isloadmore, null,
                Constant.getRootUrl() + Constant.Action.Action_AboutUS, Constant.Action.Action_AboutUS, RequestServerManager.getInstanceDIY().
                        getRequestParams(Constant.Action.Action_AboutUS, App.getUserBean().getUserid(), App.getUserBean().getSession_id()), BaseResponse.class, new ICallBackForRequestServer<BaseResponse>() {
                    @Override
                    public void onSuccess(BaseResponse result) {
                        // JSONObject jsonObject = (JSONObject) result.getData();
                        AboutUsBean aboutUsBean = JSON.parseObject(result.getData().toString(), AboutUsBean.class);
                        textView1.setText("    "+aboutUsBean.getPart1());
                        textView2.setText(aboutUsBean.getPart2());
                        textView3.setText(aboutUsBean.getPart3());

                    }

                    @Override
                    public void onFail(int type, String errorMsg, String json) {

                    }
                });
    }
}